-
Notifications
You must be signed in to change notification settings - Fork 111
Fix pressing the enter key removes heading content #3182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Wow, nice, thanks a lot @susnux. Tested and seems to work. Though the cypress failure puzzles me a bit as at least in the browser the id is properly set |
a5d521b to
16cfa6d
Compare
|
/compile |
|
/backport to stable25 |
`div` is not an allowed child element of a `hX` tag, this leads to invalid behavior on firefox so we need to use the `span` tag as the NodeView content container. Also using `tabindex=-1` on the NodeView will trigger weird behavior when clicking inside the heading and pressing the enter key. It will split the node but also copy the heading anchor link of the NodeView. Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
537ee19 to
86c8b20
Compare
|
I figured out that the |
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
|
Regarding cypress it seems that the way we clear the content editable is not very reliable in combination with the heading node view, so I moved the failing tests over to start with an empty file by default to avoid that. Something we should investigate separately in a follow up to maybe unify that logic or find a more stable way to clear the content. |
|
/compile |
|
File as follow up issues:
|
Signed-off-by: nextcloud-command <[email protected]>
|
The backport to stable25 failed. Please do this backport manually. |
|
Thanks a lot @susnux for the quick fix. Your contributions are highly appreciated. ❤️ On a separate note, we have a few public chat rooms on our Nextcloud instance, one also for text development, to stay in closer contact with community contributors and I thought it would also be cool to have you there. In case you are interested, just drop me a mail with your email address, then I can send you an invite. (Mail address is on my GitHub profile) |
Summary
divis not an allowed child element of ahXtag, this leads to invalid behavior on firefox so we need to use thespantag as the NodeView content container.Also using
tabindex=-1on the NodeView will trigger weird behavior when clicking inside the heading and pressing the enter key. It will split the node but also copy the heading anchor link of the NodeView.